﻿using System;
using System.Data;
using gms.security;

namespace gms.data {
	public class Player_Signup {
#region Properties
		public string id_code { get; set; }
		public string first_name { get; set; }
		public string last_name { get; set; }
		public string email { get; set; }
		public byte[] password { get; set; }
		public byte[] salt { get; set; }
#endregion
#region Constructors

#endregion
#region Additional Loads

#endregion
#region CRUD

#endregion
#region Utilities
		private void fill(DataSet values) {
			if (!Database.dataset_is_empty(values)) {
				for (int i = 0; i < values.Tables[0].Columns.Count; i++) {
					switch (values.Tables[0].Columns[i].ColumnName) {
						case "id_code": id_code = (string)values.Tables[0].Rows[0]["id_code"]; break;
						case "first_name": first_name = (string)values.Tables[0].Rows[0]["first_name"]; break;
						case "last_name": last_name = (values.Tables[0].Rows[0]["last_name"] != DBNull.Value) ? (string)values.Tables[0].Rows[0]["last_name"] : null; break;
						case "email": email = (string)values.Tables[0].Rows[0]["email"]; break;
						case "password": password = (byte[])values.Tables[0].Rows[0]["password"]; break;
						case "salt": salt = (byte[])values.Tables[0].Rows[0]["salt"]; break;
					}
				}
			}
		}
#endregion
	}
}
